import React, { Component } from 'react';
import { Link, routerRedux } from 'dva/router';
import { connect } from 'dva';

import { List, InputItem, Button, Toast, Flex,Icon,Tabs,WingBlank,WhiteSpace } from 'antd-mobile';

import NavTopBar from '../../components/NavTopBar/NavTopBar';
import MyScroll from '../../components/MyScroll/MyScroll';

class UserProtocol extends Component {
    constructor(props) {
        super(props);
        this.state={
            num:0,
            ret:[]
        }

    }

    render() {
        console.log(this.props);
        const {title="",content=""}= this.props.login.UserProtocol;
        return (
            <Flex style={{
                height:"100%",
                background:"#fff"
            }} direction="column"
            >
                <NavTopBar title="用户协议" dispatch={this.props.dispatch}/>
                <MyScroll>
                    {
                        this.props.login.UserProtocol!==undefined?<WingBlank>
                            <h3 style={{textAlign:"center"}}>{title}</h3>
                            <div style={{paddingBottom:"1rem"}} dangerouslySetInnerHTML={{ __html: content }}></div>
                        </WingBlank>:""
                    }
                </MyScroll>
            </Flex>
        );
    }
}

export default connect(({ login }) => ({ login }))(UserProtocol);
